tools/xenstored: Propagate correctly the error message from lu_start()
authorJulien Grall <jgrall@amazon.com>
Thu, 29 Jul 2021 11:06:02 +0000 (12:06 +0100)
committerIan Jackson <iwj@xenproject.org>
Fri, 30 Jul 2021 10:02:46 +0000 (11:02 +0100)
commit604551fb763c4c70123f642a9b2866890790e2b2
tree52a7b30357180dc1143a1ce53afcf7b2c8f454d5
parentc85610a3224a89159284f082c8c3dfb842c070fb
tools/xenstored: Propagate correctly the error message from lu_start()

lu_start() will only set errno when it returns NULL. For all the
other cases, the value is unknown.

This means that when lu_start() returns an error message, it may not
be propagated to the client.

The check that errno is a non-zero value is now dropped and instead
the value is returned when no error message is provided. This
relies on errno to always be set when ret == NULL.

Fixes: af216a99fb ("tools/xenstore: add the basic framework for doing the live update")
Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
tools/xenstore/xenstored_control.c